home *** CD-ROM | disk | FTP | other *** search
- <%@ Language=VBScript CODEPAGE=65001 ENABLESESSIONSTATE="True" %>
- <!--#include file="include/wmsLocStrings.inc"-->
- <!--#include file="include/wmsConstants.inc"-->
- <!--#include file="include/wmsCommon.inc"-->
- <!--#include file="include/wmsServerHash.inc"-->
- <!--#include file="include/wmsconnect.inc"-->
- <!--#include file="include/wmsRefresh.inc"-->
- <!--#include file="include/wmsHeader.inc"-->
- <%
- '+-------------------------------------------------------------------------
- '
- ' Microsoft Windows Media
- ' Copyright (C) Microsoft Corporation. All rights reserved.
- '
- ' File: Admin.asp
- '
- ' Contents: Frame parent per server administration
- '
- '--------------------------------------------------------------------------
-
- on error resume next
- Session.LCID = L_LOCALELCID_TEXT
-
- Dim bContinue
- Dim strServerOp
- Dim bPerformInitialization
- Dim strShowSLArg
-
- bContinue = TRUE
- strServerOp = ""
- bPerformInitialization = FALSE
- strShowSLArg = RemoveDangerousCharacters( trim( qs( "showSL" ) ) )
-
- '///////////////////////////////////////////////////////////////////////
- '
- ' This can be entered if the user retrogrades to default.asp and chooses
- ' to admin only the localhost after initially opting to admin from a
- ' server list
- '
- Sub InitSessionLocalhostOnly()
- ' Convenient place to call this
-
- Session( "Initialized" ) = TRUE
- SyncWithApplicationState
-
- Dim strServerName
- strServerName = RemoveDangerousCharacters( trim( qs( "srv" ) ) )
- ' ensure the name isn't too long
- if( ( 0 < Len( strServerName ) ) and ( MAX_LEN_SERVERNAME >= Len( strServerName ) ) ) then
- g_strQueryStringServer = ServerNameToHashKey( strServerName, TRUE )
- else
- Session( "TransferFromAdmin" ) = TRUE
- Server.Transfer( "include/server_stopped.asp" )
- end if
-
- Session( "Initialized" ) = TRUE
- Session( "ShowServerList" ) = FALSE
- Session( "LocalHostWinName" ) = g_strQueryStringServer
-
- if( 0 < Len( strServerName ) ) then
- if( 0 < Len( strShowSLArg ) ) then
- Response.Redirect( "admin.asp?server=" & g_strQueryStringServer & "&informHostWin=true" )
- else
- Response.Redirect( "admin.asp?server=" & g_strQueryStringServer )
- end if
-
- ' Clean up
- WMSServerHashASPCleanup
- WMSConnectASPCleanup
-
- Response.Flush
- end if
- strServerName = nothing
- End Sub
-
- '/////////////////////////////////////////////////////////////////////////////////////
- Function ServerIsStarted()
-
- if ( TRUE = Session( "ConnectionFailure" ) ) then
- ServerIsStarted = FALSE
- Exit Function
- end if
-
- Dim bContinue
- bContinue = TRUE
- strServerOp = RemoveDangerousCharacters( trim( qs( "serverOp" ) ) )
- ConnectToServer
- if( WMS_SERVICE_STARTED = g_dwConnectionFailureCode ) then
- bContinue = TRUE
- elseif( WMS_SERVICE_STOPPED = g_dwConnectionFailureCode ) then
- bContinue = FALSE
- elseif( IsEmpty( g_objServer ) ) then
- if( ( WMS_SERVER_UNKNOWN = g_dwConnectionFailureCode ) or ( WMS_HOST_UNAVAILABLE = g_dwConnectionFailureCode ) or _
- ( WMS_SERVICE_UNAVAILABLE = g_dwConnectionFailureCode ) ) then
- Session( "ConnectionFailure" ) = TRUE
- bContinue = FALSE
- else
- bContinue = FALSE
- end if
- end if
-
- if( 0 = StrComp( "kill", strServerOp, vbTextCompare ) ) then
- Session( "ConnectionFailure" ) = TRUE
- bContinue = FALSE
- end if
-
- ServerIsStarted = bContinue
- End Function
-
-
- '/////////////////////////////////////////////////////////////////////////////////////
- '
- ' Process the query string and initialize the session if necessary
- '
- '/////////////////////////////////////////////////////////////////////////////////////
- if( FALSE = Session( "Initialized" ) ) then
- bPerformInitialization = TRUE
- elseif( 0 < Len( RemoveDangerousCharacters( trim( qs( "srv" ) ) ) ) ) then
- '
- ' The Windows Media Encoder Admin UI may call us, in which case we're being entered from
- ' somewhere beyond the serverlist page; therefore, we must hash the servername and use it.
- '
- bPerformInitialization = TRUE
- elseif( 0 < Len( strShowSLArg ) ) then
- if( ( 0 = StrComp( "false", strShowSLArg, vbTextCompare ) ) and ( TRUE = Session( "ShowServerList" ) ) ) then
- bPerformInitialization = TRUE
- end if
- end if
-
- if( bPerformInitialization ) then
- InitSessionLocalhostOnly
- end if
-
- BrowserSniff
- PickStyleSheet
- RedirectIfLegacyBrowser
-
- if( 0 = Len( CStr( Session( "BaseHREF" ) ) ) ) then
- Session( "BaseHREF" ) = Request.ServerVariables( "HTTP_HOST" )
- end if
-
- bContinue = ServerIsStarted()
-
- if( FALSE = bContinue ) then
- Session( "TransferFromAdmin" ) = TRUE
- Server.Transfer( "include/server_stopped.asp" )
- end if
-
-
- '/////////////////////////////////////////////////////////////////////////////////////
- '
- ' Generate the frameset
- '
- '/////////////////////////////////////////////////////////////////////////////////////
- WriteHTMLFramesetHeader %>
- <title>
- <%= Server.HTMLEncode( L_ASPADMINDESCRIPTION_TEXT ) & " : " & Server.HTMLEncode( g_strServerName ) %>
- </title>
- <%
- if brMSIE = g_dwBrowserType then %>
- <script language="JavaScript">
- <!--
- <%
- '//
- '// This code serves as a semaphore so that the right-hand pane won't try
- '// to set the tree state (highlighted node) until the treeview pane has
- '// finished loading. Its onLoad event handler will invoke SetTreeReady.
- '// The right-hand pane will wait until this flag is set via periodic
- '// calls to IsTreeReady() before telling it which node is active.
- '//
- %>
- var g_bTreeReady = false;
-
- function SetTreeReady()
- {
- g_bTreeReady = true;
- }
-
- function IsTreeReady()
- {
- return( g_bTreeReady );
- }
- -->
- </script>
- <%
- end if %>
- <frameset rows="*,30" frameborder="0" framespacing="0">
- <frameset cols="230,*" border=1 framespacing=1 frameborder=1>
- <frame name="treeFrames" src="treeframes.asp?server=<%= g_strQueryStringServer %>" frameborder="yes" topmargin="0" leftmargin="0" rightmargin="0" marginwidth="0" marginheight="0" framespacing="0" scrolling="auto">
- <frame name="frameDetails" src="pages/server.asp?server=<%= g_strQueryStringServer %>" frameborder="0" topmargin="0" leftmargin="0" rightmargin="0" marginwidth="0" marginheight="0" framespacing="0" scrolling="auto">
- </frameset>
- <frame name="WMSSession" src="WMSSession.asp?server=<%= g_strQueryStringServer %>&informHostWin=<%= RemoveDangerousCharacters( Left( trim( qs( "informHostWin" ) ), 3 ) ) %>" noresize frameborder="no" topmargin="0" leftmargin="0" rightmargin="0" marginwidth="0" marginheight="0" framespacing="0" scrolling="no">
-
- <noframes>
- <body oncontextmenu="JavaScript:return true;event.cancelBubble=true;return false;">
- <p>
- <%= Server.HTMLEncode( L_NOFRAMESUPPORT_TEXT ) %>
- <p>
- </body>
- </noframes>
-
- </frameset>
- </html>
- <%
- ' Clean up
- on error resume next
- WMSServerHashASPCleanup
- WMSConnectASPCleanup
- %>